<template>
  <div>



    <div style="width: 100px;display: inline-block;">
  
    <router-link to="/login" ></router-link>


  </div>
    <div style="width: 100px;display: inline-block;">

      
    </div>
    <KeepAlive>
      <router-view></router-view>
    </KeepAlive>
  </div>
</template>

<script>
import {useUser} from '@/store/modules/user'
import {mapState,mapActions} from 'pinia';

import {login,addUser} from "@/api/user"

export default {
  computed:{
    ...mapState(useUser,['user','counter'])
  },
 
  data() {
    return {
    };
  },
  mounted(){
    console.log("this.user",this.user);
    console.log("this.counter",this.counter);
    this.setCounter(6)
  },
  methods:{
    ...mapActions(useUser,['setCounter','doLogin']),
    getRequest(){
      let user = {
        username: 'admin',
        password: '123456'
      }
      this.doLogin(user).then(res => {
        console.log(res)
      })
    },
    postRequest(){
      let su = {
        account: 'admin',
        password: '123456'
      }
      addUser(su).then(res => {
        console.log(res)
      })
    },
  }
  
};
</script>

<style>
</style>
